<#include "../common/head.ftl">
<!--contaniner-->
<div id="box">
 <!--boxleft-->
 <div class="boxleft">
  <ul>
  <li>
   <#if enterpriseInit[0].ent_status=="0">
  <a href="javascript:void(0)" onclick="correctEmergent()">急招</a>
   <#else>
   <a href="javascript:void(0)" onclick="erroremergentMsg();">急招</a>
   </#if>
   </li>
   <li><a href="${base}/postoffice">发布职位</a></li>
   <li class="currentjob"><a href="${base}/ownjob" style="color:#0089e9;">我的职位</a></li>
  </ul>
 </div>
 <!--/.boxleft-->
 <!--boxright-->
 <#if job_list??>
 <#list job_list as jl>
 <#assign id=jl.id/>
 <div class="boxright">
    <!--7-2con1-->
    <div class="jobintruduction">
     <div class="jobintruduction_l">
      <div class="jobtitle">
       <p class="pone">${jl.job_type_name }｜${jl.industry_name }</p>
       <#if jl.title?length gte 10>
       <#assign tit=jl.title?substring(0,10)+"……">
       <#else>
       <#assign tit=jl.title>
       </#if>
       <p class="ptwo">${jl.title}</p>
      </div>
      <div class="icoinfo">
       <ul>
       <#if jl.salary_min=="1000" && jl.salary_max=="20000">
       <li class="money">面议</li>
       <#elseif jl.salary_min=="20001" && jl.salary_max=="60000">
       <li class="money">20001以上</li>
       <#else>
       <li class="money">${jl.salary_min }—${jl.salary_max }</li>
       </#if>
       	
        <li><img src="${base}/resources/images/ico1_07.jpg" alt="" style="vertical-align:middle;"/> ${jl.work_type }</li>
        <li><img src="${base}/resources/images/465659_07.jpg" alt="" style="vertical-align:middle;"/> 招聘人数：${jl.need_count }人</li>
        <li><img src="${base}/resources/images/56565626_07.jpg" alt="" style="vertical-align:middle;"/> 工作经验：${jl.work_exp_type }</li>
       </ul>
      </div>
      <div class="address"><img src="${base}/resources/images/adress.jpg" alt="" style="vertical-align:middle;"/> 地点：${jl.city_name_1}${jl.city_name_2}${(jl.city_name_3!="null")?string(jl.city_name_3,"")}${jl.address }</div>
      <div class="perioddate">发布时间：<em>${jl.refresh_time}</em></div>
      
     </div>
     <div class="jobintruduction_r">
      <#assign job_status=jl.emergent>
      <#if jl.emergent==1>
      <img src="${base }/resources/images/jizhao.png" alt=""/>
      <p>${jl.status}</p>
      <#else>
      <span class="examine">${jl.status}</span>
      </#if>
     </div>
    </div>
    <!--/.7-2con1-->
    
    <!--7-2con2-->
    <div class="jobdescription">
      <span><img src="${base}/resources/images/code.png" alt=""> 职位描述：</span>
      <p>${jl.job_description?replace('\n',"<br/>")?replace('\r',"<br/>")?replace('\r\n',"<br/>")?replace(' ','&nbsp')}</p>
    </div>
    <!--/.7-2con2-->
    
    <!--7-2con3-->
    <div class="jobedit">
      <ul>
      <li>
      	 <#if jl.status='上线' || jl.status='正常'><!-- 审核中职位不能编辑 -->
      	 <a href="javascript:void(0)" onclick="fresh()">刷新职位</a></li>
      	 </#if>
       <li>
       
       <#if jl.status='审核中'><!-- 审核中职位不能编辑 -->
       	<a href="javascript:void(0)" onclick="editJob()">编辑职位</a>
       <#else>
       	<a href="${base}/updatejob/job${id}.html">编辑职位</a>
       </#if>
       </li>
       <#if jl.status=="上线" ||jl.status=="正常">
       <#if jl.emergent==0>
       <li class="addyx"><a href="javascript:;" style="color:#8e8e8e;">设置急招</a></li>
       <!-- <li><a href="#" style="color:black;" id="open">设置急招</a></li> -->
       </#if>
       </#if>
       
       <#if jl.status=="下线">
       <li><a href="javascript:void(0)" onclick="onLine()">上线</a>|<a href="javascript:void(0)" style="color:#8e8e8e;">下线</a></li>
       <#elseif jl.status=="正常" || jl.status=="上线">
        <li><a href="javascript:void(0)" style="color:#8e8e8e;" >上线</a>|<a href="#" onclick="offLine()">下线</a></li>
       </#if>
       <li>
       		<#if jl.status!='审核中'><!-- 审核中职位不能编辑 -->
			<a href="javascript:void(0)" onclick="del_job()">删除职位</a></li>
			</#if>
		</li>
       <li>
      </ul>
    </div>
    <!--/.7-2con3-->
    
    
    <!--7-2con4-->
    <div class="joblook">
      <p>
      收到简历 ${num}份
      <#assign number=num?number>
      <#if number gt 0>
      <a href="${base}/ownjob/jobresume?job=${id}"><input type="submit" value="查看简历" class="jobbtn"></a>
      <#else>
      <input type="submit" value="查看简历" class="jobbtn jobbtnoff">
      </#if>
      </p>
    </div>
    <!--/.7-2con4-->
 </div>
 </#list>
 </#if>
 <!--/.boxright-->
 
  <!--清浮动-->
 <div style="clear:both"></div>
 
</div>
<!--/.contaniner-->
    

<!--footer-->
<#include "../common/bottom.ftl">
<!--/.footer-->


 <style type="text/css">
/*弹出层css*/
.jzbg{
  width: 100%;
  height: 100%;
  position:fixed;
  top: 0;
  left: 0;
  bottom:50%;
  /*z-index: 99999!important;*/
  overflow: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  background: rgba(35,35,35,.7);
  filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f000000,endColorstr=#7f000000);
  display:none;
}
</style>

<!--设置急招弹出层con-->
<div class="jzbg"></div>
<div class="PopupLayer"> 
  <a class="close"></a>
  <p class="setjob">设置急招职位</p>
  <p class="planob">计划接收简历数量</p>
  <ul class="setjobnum">
    <li><input type="radio" name="count" class="rad" value="30" checked>30份</li>
    <li><input type="radio" name="count" class="rad" value="50">50份</li>
    <li><input type="radio" name="count" class="rad" value="100">100份</li>
  </ul>
  <p class="smatip">提示：成功设置急招职位72小时后，或者此职位收到的简历达到目标数量，此职位急招效果失效。</p>
  <input type="submit" value="确定" class="surebtn">
</div>
<!--/.设置急招弹出层con--> 

<!--设置急招弹出层js-->
<script src="${base}/resources/js/jquery-1.10.2.js" type="text/javascript"></script>
<script>
    $(".addyx").click(function(){
        $(".PopupLayer,.jzbg").show();
    });
    $(".close").click(function(){
        $(".PopupLayer,.jzbg").hide();
    });
    $(".surebtn").click(function(){
        $(".PopupLayer,.jzbg").hide();
    });
</script>
<!--/.设置急招弹出层js-->


<!--7-4弹出层js-->
<script type="text/javascript" src="${base}/resources/js/jquery-1.4.4.js"></script> 
<script>
	$(function(){
		
		$("#open").click(function(){
			notice_show();
		})//单击按钮触发显示
		
		$("#close").click(function(){
			notice_hidden();
		})//单击按钮触发隐藏
		
		$(".surebtn").click(function(){
			setEmergent();
		});
		
	})
	
	//设置急招职位
	function setEmergent(){
		var reqURL="${base}/ownjob/set_emergent";
		$.post(reqURL,{
			'ent_job_id' : '${id}',
			'max_count' : $("input:radio:checked").val()
		},function(data){
			if(data.success){
				layer.alert('设置急招职位操作成功!', {
					icon: 1,
				    skin: 'layui-layer-moon' 
				    ,closeBtn: 0
				}, function(){
					window.location.reload();
				});
			}else{
				layer.alert("该企业已设置急招职位", {icon: 0,skin: 'layer-ext-moon'});
			}
		});
	};
	
	//设置职位上线
	function onLine(){
		var reqURL="${base}/ownjob/set_status";
		$.post(reqURL,{
			'ent_job_id' : '${id}',
			'status' : 0
		},function(data){
			if(data.success){
				layer.alert('职位上线操作成功!', {
					icon: 1,
				    skin: 'layui-layer-moon' 
				    ,closeBtn: 0
				}, function(){
					window.location.reload();
				});
			}else{
				layer.alert(data.message, {icon: 0,skin: 'layer-ext-moon'});
			}
		});
	};
	
	//设置职位下线
	function offLine(){
		var reqURL="${base}/ownjob/set_status";
		$.post(reqURL,{
			'ent_job_id' : '${id}',
			'status' : 1
		},function(data){
			if(data.success){
				layer.alert('职位下线操作成功!', {
					icon: 1,
				    skin: 'layui-layer-moon' 
				    ,closeBtn: 0
				}, function(){
					window.location.reload();
				});
			}else{
				layer.alert(data.message, {icon: 0,skin: 'layer-ext-moon'});
			}
		});
	}
	
	//刷新职位
	function fresh(){
		var reqURL="${base}/ownjob/set_status";
		$.post(reqURL,{
			'ent_job_id' : '${id}',
			'status' : -8
		},function(data){
			if(data.success){
				layer.alert('职位刷新成功!', {
					icon: 1,
				    skin: 'layui-layer-moon' 
				    ,closeBtn: 0
				}, function(){
					window.location.reload();
				});
			}else{
				layer.alert(data.message, {icon: 0,skin: 'layer-ext-moon'});
			}
		});
	};
	
	//删除职位
	function del_job(){
		var reqURL="${base}/ownjob/set_status";
		layer.confirm("确认删除?",{icon: 0}, function(){ 
			$.post(reqURL,{
				'ent_job_id' : '${id}',
				'status' : -9
			},function(data){
				if(data.success){
					layer.alert('删除职位成功!', {
						icon: 1,
					    skin: 'layui-layer-moon' 
					    ,closeBtn: 0
					}, function(){
						location.href="${base}/ownjob";
					});
				}else{
					layer.alert(data.message, {icon: 0,skin: 'layer-ext-moon'});
				}
			});
	  	});
		
	};
	
	function erroremergentMsg(){
		layer.alert("企业未设置急招职位", {icon: 0,skin: 'layer-ext-moon'});
	};
	
	function correctEmergent(){
		var reqURL="${base}/checkEme";
		$.post(reqURL,function(data){
			if(data.success){
				location.href="${base}/emergent";
			}else{
				layer.alert("企业未设置急招职位", {icon: 0,skin: 'layer-ext-moon'});
			}
		});
	}
	
	function editJob(){
		layer.alert("不能编辑审核中的职位", {icon: 0,skin: 'layer-ext-moon'});
	}
</script> 
<!--/.7-4弹出层js-->

</body>
</html>